//
// Created by work on 24-7-5.
//

#ifndef IOT_PLAT_CCONFIGS_H
#define IOT_PLAT_CCONFIGS_H

#include <iostream>
#include <memory>
#include <os/miscellany/tinyxml2.h>

namespace iotplat {
    using namespace tinyxml2;
    class CConfigs {
        CConfigs();
        CConfigs(const CConfigs&) = delete;
        CConfigs& operator=(const CConfigs&) = delete;
        CConfigs(CConfigs&&) = delete;
        CConfigs& operator=(CConfigs&&) = delete;
    public:
        enum EDateBase {
            EPlat
        };

        struct SDataBaseCfg{
            std::string ip;
            short int port;
            std::string engine;
            std::string lib;
            std::string username;
            std::string password;
        };

        struct SRedisCfg{

        };

    public:
        static CConfigs& ins();

        struct SDataBaseCfg dateBaseCfg(enum EDateBase type);

    private:
        std::shared_ptr<XMLDocument> doc;
        XMLElement * root;
    };

} // iotplat

#endif //IOT_PLAT_CCONFIGS_H
